<?php
function ObtenerNavegador($user_agent) {  
     $navegadores = array(  
          'Opera' => 'Opera',  
          'Mozilla Firefox'=> '(Firebird)|(Firefox)',  
          'Galeon' => 'Galeon',  
          'Mozilla'=>'Gecko',  
          'MyIE'=>'MyIE',  
		  'iPhone'=>'iPhone',
          'Lynx' => 'Lynx',  
          'Netscape' => '(Mozilla/4\.75)|(Netscape6)|(Mozilla/4\.08)|(Mozilla/4\.5)|(Mozilla/4\.6)|(Mozilla/4\.79)',  
          'Konqueror'=>'Konqueror',  
          'Internet Explorer 7' => '(MSIE 7\.[0-9]+)',  
          'Internet Explorer 6' => '(MSIE 6\.[0-9]+)',  
          'Internet Explorer 5' => '(MSIE 5\.[0-9]+)',  
          'Internet Explorer 4' => '(MSIE 4\.[0-9]+)',  
	);  
	foreach($navegadores as $navegador=>$pattern){  
       	if (@eregi(@$pattern, @$user_agent))  
       	return @$navegador;  
    	}  
	return 'Desconocido';  
	}
	
	if(ObtenerNavegador($_SERVER['HTTP_USER_AGENT'])=="iPhone")
	{
		echo "Agente: " . ObtenerNavegador($_SERVER['HTTP_USER_AGENT']);
		echo "<div style='width:500px;'>";
	}
?>
<!doctype html>
<html lang="en">

<head>
	<meta charset="utf-8"/>
	<title>Sistema de Almacén</title>
	
	<link rel="stylesheet" href="css/layout.css" type="text/css" media="screen" />
	<!--[if lt IE 9]>
	<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen" />
	<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->
	<link href='images/sisalmacen2.ico' rel='shortcut icon' type='image/x-icon'>
	<script src="js/datetimepicker/datetimepicker.js" type="text/javascript" language="javascript"></script>
	<script src="js/jquery-1.5.2.min.js" type="text/javascript"></script>
	<script src="js/hideshow.js" type="text/javascript"></script>
	<script src="js/jquery.tablesorter.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="js/jquery.equalHeight.js"></script>
	<script type="text/javascript">
	$(document).ready(function() 
    	{ 
      	  $(".tablesorter").tablesorter(); 
   	 } 
	);
	$(document).ready(function() {

	//When page loads...
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	//On Click Event
	$("ul.tabs li").click(function() {

		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content

		var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active ID content
		return false;
	});

});
    </script>
    <script type="text/javascript">
    $(function(){
        $('.column').equalHeight();
    });
</script>

</head>


<body>

	<header id="header">
		<hgroup>
			<h1 class="site_title"><a href="index.php">Sistema de  Almacén</a></h1>
			<?php if (isset($_SESSION["userRow"]["UsuarioRol"]) && (strtoupper($_SESSION["userRow"]["UsuarioRol"])=="ADMINISTRADOR")) {?>
			<h2 class="section_title">Panel del Administrador</h2>
			<?php }else if(isset($_SESSION["userRow"]["UsuarioRol"]) && (strtoupper($_SESSION["userRow"]["UsuarioRol"])=="RESPONSABLE")) {?>
			<h2 class="section_title">Panel del Responsable</h2>
			<?php }else{?>
			<h2 class="section_title">Acceso al sistema</h2>
			<?php }?>
			<?php if (isset($_SESSION["userRow"]["UsuarioLogin"])) {?>
			<div class="btn_view_site"><a href="index.php?controlador=logout">Salir</a></div>
			<?php }?>
		</hgroup>
	</header> <!-- end of header bar -->
	<?php if (isset($_SESSION["userRow"])) {?>
	<section id="secondary_bar">
		<div class="user">
			<?php //if (isset($_SESSION["userRow"]["UsuarioLogin"])) {?>
			<p><?php echo $_SESSION["userRow"]["UsuarioLogin"] ?></p>
			<?php //} ?>
			<!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
		</div>
		<div class="breadcrumbs_container">
			<?php if (isset($_SESSION["userRow"]["UsuarioNombre"])) {?>
			<p>&nbsp;&nbsp;&nbsp;&nbsp;Bienvenido [<strong><?php echo $_SESSION["userRow"]["UsuarioNombre"] ?></strong>]</p>
			<?php } ?>

		</div>
	</section><!-- end of secondary bar -->
	<?php }?>	